package com.maimao.search.client;

import com.maimao.core.constant.ServiceContainer;
import com.maimao.core.interceptor.FeignInterceptor;
import com.maimao.core.model.resp.Result;
import com.maimao.model.goods.SpecDetails;
import com.maimao.model.goods.vo.GoodsInfo;
import com.maimao.search.client.factory.GoodsFallBackFactory;
import com.maimao.search.client.factory.SpecDetailFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/12/22 7:54 下午
 */
@RequestMapping("/goods/spec/detail")
@FeignClient(contextId = "specDetailClient", value = ServiceContainer.GOODS_SERVICE, fallbackFactory = SpecDetailFallBackFactory.class, configuration = FeignInterceptor.class)
public interface SpecDetailClient {

    /**
     * 分页查询商品信息
     */
    @GetMapping("/client/paramOfsearch")
    public Result<List<SpecDetails>> findSearchSpecByCid(@RequestParam("cid") Integer categoryId);

    @PostMapping("/client/paramOfsearchBatch")
    Result<List<SpecDetails>> findSearchSpecByCidBatch(@RequestBody List<Integer> categoryIdList);
}
